#include "elementmanager.h"

void ElementManager::init()
{
    QList<SuperElement *> plays;
    m_map.insert("play", plays);

    QList<SuperElement *> bubbles;
    m_map.insert("bubble", bubbles);

    QList<SuperElement *> boxs;
    m_map.insert("box", boxs);

    QList<SuperElement *> props;
    m_map.insert("prop", props);

    QList<SuperElement *> backgrounds;
    m_map.insert("background", backgrounds);

    QList<SuperElement *> bombs;
    m_map.insert("bomb", bombs);
}

ElementManager &ElementManager::instance()
{
    static ElementManager instance;
    return instance;
}

void ElementManager::load()
{
    ElementLoad::instance().readImageIni();
    ElementLoad::instance().readPlayerIni();
    ElementLoad::instance().readGameIni();
    ElementLoad::instance().readBoxIni();



}

QList<SuperElement *> ElementManager::getElementList(const QString &key) const
{
    return m_map.value(key);
}

QHash<QString, QList<SuperElement *> > ElementManager::getMap() const
{
    return m_map;
}

void ElementManager::setElementByPx(int row, int col, const SuperElement &superElement)
{

}

void ElementManager::setElementByIndex(int row, int col, const SuperElement &superElement)
{

}

SuperElement* ElementManager::getElementPyPx(int row, int col) const
{
    return Q_NULLPTR;

}

SuperElement* ElementManager::getElementPyIndex(int row, int col) const
{
    return Q_NULLPTR;
}
